import { createApp } from "vue";

// ElementPlus 按需导入时，针对一些反馈组件，需要单独导入样式
import "element-plus/es/components/message/style/css";
import "element-plus/es/components/message-box/style/css";

import router from "@/router";
import store from "@/store";

import App from "@/App.vue";
import { auth } from "@/directives";

// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 注册全局自定义指令
app.directive("auth", auth);

app.use(router);
app.use(store);

app.mount("#app");
